function flashCode(obj) {
    obj.src = "userCode?aaa" + Math.random();
}
function userLogin() {
    // window.location.href = "Login";
    $.ajax({
        url:'userLogin',
        type:'post',
        data:{
            'name':document.getElementById('userName').value,
            'pwd':document.getElementById('userPwd').value,
            'code':document.getElementById('code').value
        },
        async:true,
        dataType: 'JSON',
        success:function (resp) {
            console.log(resp);
            alert(resp.message);
            if (resp.id == 0){
                window.location.href = resp.location;
            }
            
        },
        error:function (err) {
            alert('请联系管理员！');
        }
    })
}
